import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './vant/index.js'
import 'vant/lib/icon/local.css'
import './mock/mock'
import loading from './utils/loading'
Vue.use(loading)
Vue.config.productionTip = false

if (process.env.NODE_ENV === 'production') {
  window.apiready = function() {
    new Vue({
      router,
      store,
      render: h => h(App),
    }).$mount('#app')
    // $api.fixStatusBar($api.dom('#main'))
  }
} else {
  new Vue({
    router,
    store,
    render: h => h(App),
  }).$mount('#app')
}

window.addEventListener(
  'popstate',
  function(e) {
    router.isBack = true
  },
  false
)
